/*
* @Author: monster
* @Date:   2017-09-18 22:06:16
* @Last Modified by:   monster
* @Last Modified time: 2017-09-21 23:10:43
*/
'use strict';
// 配置路由，进行依赖注入
angular.module('app').config(['$stateProvider','$urlRouterProvider',
	function($stateProvider,$urlRouterProvider){
		$stateProvider.state('main',{
			url: '/main',
			templateUrl: 'view/main.html',
			controller: 'mainCtrl'
		}).state('position',{
			url: '/position/:id',
			templateUrl: 'view/position.html',
			controller: 'positionCtrl'
		}).state('company',{
			url: '/company/:id',
			templateUrl: 'view/company.html',
			controller: 'companyCtrl'
		}).state('search',{
			url: '/search/',
			templateUrl: 'view/search.html',
			controller: 'searchCtrl'
		}).state('login',{
			url: '/login/',
			templateUrl: 'view/login.html',
			controller: 'loginCtrl'
		}).state('register',{
			url: '/register/',
			templateUrl: 'view/register.html',
			controller: 'registerCtrl'
		}).state('me',{
			url: '/me/',
			templateUrl: 'view/me.html',
			controller: 'meCtrl'
		}).state('collect',{
			url: '/collect/',
			templateUrl: 'view/collect.html',
			controller: 'collectCtrl'
		}).state('post',{
			url: '/post/',
			templateUrl: 'view/post.html',
			controller: 'postCtrl'
		});
		// 当路径不匹配时，定向到main
		$urlRouterProvider.otherwise('main');
	}])